<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>欧冠</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
        box-sizing: content-box;
    }

    html, body {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    @keyframes breathe {
        0% {
            opacity: 0.5;
        }
        50% {
            opacity: 1;
        }
        100% {
            opacity: 0.5;
        }
    }


    h2 {
        position: absolute;
        bottom: 90px;
        color: #ffffff;
        left: 25%;
        transform: translateX(-50%);
        font-size: 16px;
        animation: breathe 3s ease-in-out infinite;
    }

    video::-webkit-media-controls { 
        /* display:none !important; */
    }
</style>
<body>
    <video src="https://files.catbox.moe/nl0ldn.mp4" autoplay preload id="video" poster="../image/ucl.png"></video>
    <h2 id="label"></h2>


    <script>
        var label = document.getElementById("label");
        let count = 0
        let isloading = true
        label.textContent = "加载中..."
        setTimeout(() => {
            label.textContent = "轻触开始杯赛",
            isloading = false
        }, 4000);
        window.onload = function(){
            let timer = setInterval(() => {
                var video = document.getElementById("video");
                if (video.paused) {
                    //判读是否播放 
                    if (count === 0 && !isloading)
                    {
                        video.play(); //没有就播放
                    }
                }  
                else
                {
                    count += 1
                    clearInterval(timer);
                    label.style.display = "none";
                }
               
            }, 60);
        }
    </script>

</body>
</html>